import { defineStore } from "pinia";
import { reactive } from "vue";

export const useStore = defineStore('insure', () => {
  const state = reactive({
    code: 'hmb2024',
    product_id: '',
    price: 0,
    term_pact: [],
  })

  const setInfo = (e: any) => {
    state.product_id = e.product_id || '';
    state.price = Number(e.price) || 0;
    state.term_pact = e.term_pact || [];
  }

  return {
    state,
    setInfo,
  }
})